<!DOCTYPE html>
<html>
<head>
    <title>日新网 - 项目库</title>
    <meta name="keywords" content="{$seo_keywords}"/>
    <meta name="description" content="{$seo_description}">
    <meta name="referrer" content="origin">
    <tc_include file="Public:head"/>
    <link href="/themes/simplebootx/Public/assets/css/reset.css" rel="stylesheet"/>
    <link href="/themes/simplebootx/Public/assets/css/sl_style.css?v={$SOURCE_VERSION}" rel="stylesheet"/>
    <script type="text/javascript" src="__PUBLIC__/js/rem.js"></script>
    <style>
        .ellipsis2 {overflow: hidden; text-overflow:ellipsis; display: -webkit-box; -webkit-line-clamp: 2;-webkit-box-orient: vertical;}
        .question_index .title {
            width: 1.4rem;
            margin-left: auto;
            margin-right: auto;
        }

        @media screen and (max-width: 751px) {
            .tuning dd {
                margin-right: 0px !important;
                margin-bottom: .16rem;
            }
            .pc_project {
                margin-top: .62rem;
            }
            .select_area {
                height: 26px;
            }
            .navbar {
                display: none;
            }
            .pc_project{
                margin-top: -.4rem;
            }

        }

        @media screen and (min-width: 751px    ) {
            .pc_project {
                width: 1200px;
                margin: 52px auto 0;

            }

            .object_item span {
                font-size: 22px !important;
                /*width: 15% !important;*/
            }

            .project_label_item .dt13 {
                height: 10px !important;
            }
            .select_area {
                height: 36px;
            }
            .td4 {
                text-align: center;
            }
            .td3{
                line-height: 30px!important;
                box-sizing: border-box;
                padding-top: 20px;
                height: 80px!important;
                overflow: hidden;
            }
            .td5 {
                text-align: center!important;
                margin-left: 20px;
            }
            .project_label_item dt {
                position: relative;
                top: 6px;
            }

        }

        .select_area {
            /*height: .3rem;*/
            line-height: .26rem;
            display: inline-block;
            width: 25%!important;
            color: #707070;
            font-size: .14rem;
            padding: 0 .08rem;
            border: 1px solid #707070;
            letter-spacing: .02rem;
            border-radius: .1rem;
            margin: 0 .07rem;
            margin-bottom: .1rem;
        }


        dl dd {
            cursor: pointer;
        }

        .select {
            background-color: #ff7742;
        }
        .object_item .img_top {
            width: 1.3rem;
            height: .86rem;
            display: inline-block;
            padding: .04rem;
            box-sizing: border-box;
        }
        .object_item .img_top img {
            display: inline-block;
            width: 100%;
            height: 100%;
        }

        .hover_item:hover {
            transform: scale(1.02,1.02);
            box-shadow: 6px 2px 17px 1px rgba(0,0,0,.1);
        }
    </style>
</head>
<body>
<tc_include file="Public:nav"/>
<div class="pc_project">
    <div class="question_index comWidth">
        <p class="title">日新项目库</p>
    </div>

    <div class="comWidth project_index">
        <form id="search" action="{:U('Xiaoqu/Xiaoqu/index')}" method="post">

            <input type="hidden" name="category_id" value="{$formget.category_id|default=0}">
            <input type="hidden" name="year" value="{$formget.year|default=0}">

            <!--项目类型-->
            <div class="project_label_item clearfix">
                <dl>
                    <dt>项目类型</dt>
                    <dd class="category_dd {$formget['category_id'] == 0 ? 'select' : ''}" data-id="0">全部</dd>
                    <volist name="categorys" id="vo">
                        <dd class="category_dd {$formget['category_id'] == $vo['id'] ? 'select' : ''}" data-id="{$vo.id}">{$vo.name}</dd>
                    </volist>
                </dl>
            </div>

            <!--项目城市-->
            <div class="project_label_item clearfix">
                <dl>
                    <dt>项目城市</dt>
                    <div id="areaInfo">
                        <input name="city_id" hidden>
                    </div>
                </dl>
            </div>

            <!--建筑年代-->
            <div class="project_label_item clearfix">
                <dl class="tuning">
                    <dt class="dt13" style="height: 1.3rem;">建筑年代</dt>
                    <dd class="year_dd {$formget['year'] == 1 ? 'select' : ''}" data-year="1">1995年以前</dd>
                    <dd class="year_dd {$formget['year'] == 2 ? 'select' : ''}" data-year="2">1995-2000年</dd>
                    <dd class="year_dd {$formget['year'] == 3 ? 'select' : ''}" data-year="3">2001-2005年</dd>
                    <dd class="year_dd {$formget['year'] == 4 ? 'select' : ''}" data-year="4">2006-2010年</dd>
                    <dd class="year_dd {$formget['year'] == 5 ? 'select' : ''}" data-year="5">2010年以后</dd>
                </dl>
            </div>
        </form>

        <div class="tab_content">
            <volist name="lists" id="vo">
                <a href="{:U('Xiaoqu/Xiaoqu/xiaoqu_info', ['id' => $vo['id']])}" class="xiaoqu_item">
                    <div class="hover_item">
                        <div class="object_item">
                            <div class="img_top">
                                <img src="{$vo.imgs}"  alt="">
                            </div>
                            <span class="td1">{$vo.name}</span>
                            <span class="td2">{$vo.category_names}</span>
                            <span class="td3 ellipsis2">{$vo.addr}</span>
                            <span class="td4"><?php echo $vo['build_time'] > 0 ? $vo['build_time'].'年' : ''?></span>
                            <span class="td5">{$vo.manager_company}</span>
                        </div>
                    </div>
                </a>
            </volist>
            <!--加载更多-->
            <div style="width:110px;height: 30px;border-radius: 15px;border: 1px solid #C8161D; color: #C8161D;font-size: 15px;text-align: center;
            line-height: 30px;margin-left: 350px; " class="js-infinite-scroll-loading text-center fontmsyhbd">更多</div>
            <div id="nextpage"></div>
        </div>
    </div>
</div>
<!-- JavaScript -->
<tc_include file="Public:scripts"/>
<script src="__TMPL__Public/assets/js/jquery.infiniteScroll.js"></script>
<script src="__PUBLIC__/js/layer/layer_1.js"></script>
<script src="__PUBLIC__/js/area.js"></script>
<script>
    var area = {$area};
    area = eval(area);

    var areaPath = {$path ? $path : []};
    areaPath = eval(areaPath);

    $(function () {
        // 地址选择select的初始化
        initArea(3);
        // 搜索
        $(document).delegate('.category_dd', 'click', function () {
            var category_id = $(this).attr('data-id');
            $('input[name="category_id"]').val(category_id);
            $('#search').submit();
        });
        $(document).delegate('.year_dd', 'click', function () {
            var year = $(this).attr('data-year');
            $('input[name="year"]').val(year);
            $('#search').submit();
        });

        $('#nextpage').infiniteScroll({
            loading: '.js-infinite-scroll-loading',
            total_pages: {$total_pages},
            success: function (content) {
                var $items = $(content).find('.xiaoqu_item');
                if ($items.length > 0) {
                    $('.js-infinite-scroll-loading').before($items);
                }
            }
        });
    });

    // 地址变动回调
    function select_area_callback() {
        $('#search').submit();
    }
</script>
</body>
</html>